package lab02.Test11;

/**
 * Created by lenovo on 2017/10/25.
 */
public class Square extends Rectangle {
    //属性：边长
    double side;
    //方法：求对角线
    double diagonal(){return (Math.sqrt(side*side+side*side));}
    @Override
    double area() {
        return super.area();
    }

    @Override
    double premiter() {
        return super.premiter();

    }

    @Override
    public void printMyWay() {
        super.printMyWay();
        System.out.println("边长");
        System.out.println(side);
        System.out.println("周长");
        System.out.println(premiter());
        System.out.println("面积");
        System.out.println(area());
        System.out.println("对角线");
        System.out.println(Math.sqrt(side*side+side*side));

    }

    public static void main(String[] args) {

    }
}
